package com.lulin.mall.order.config;
import com.lulin.mall.order.interceptor.AuthInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 配置拦截器，要拦截哪些请求
 *
 * @author lulin
 * @date 2022/12/14 15:10
 */
@Configuration
public class MyWebInterceptorConfig implements WebMvcConfigurer {
    /**
     * 需要拦截的哪些请求
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //拦截所有的请求
        registry.addInterceptor(new AuthInterceptor()).addPathPatterns("/**");
    }
}
